package com.indobrains.uud1945;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class PasalAdapter extends SimpleCursorAdapter {
	private static final String TAG = "Pasal Adapter";
	private int layout;
	private Context mContext;
	public PasalAdapter(Context context, int layout,Cursor c, String[] from, int[] to){
		super(context,layout,c,from,to);
		this.layout=layout;
		this.mContext=context;
	}
	@Override
	public void bindView(View v, Context context, Cursor c) {
		// TODO Auto-generated method stub
		//super.bindView(v, context, c);
		int _id=c.getInt(0);
		String s_title=c.getString(1);
		String s_desc=c.getString(2);
//		String s_note=c.getString(3);
//		String s_older=c.getString(4); 
		TextView title=(TextView)v.findViewById(R.id.ClauseTitle);
		TextView description=(TextView)v.findViewById(R.id.ClauseAmandemen);
//		TextView note=(TextView)v.findViewById(R.id.note);
//		TextView oldversion=(TextView)v.findViewById(R.id.old_version);
//		TextView recno=(TextView)v.findViewById(R.id.rec_no);
		title.setText(s_title);
		description.setText(s_desc);
		
	}
	@Override
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		// TODO Auto-generated method stub
		//return super.newView(context, cursor, parent);
		final LayoutInflater inflater = LayoutInflater.from(context);
		View v = inflater.inflate(layout, parent, false);
		return v;
	}
}
